<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class Neos extends Model
{
    //
    protected $pk = 'id';

    // 获取表数据的总条数
    public function getTableCnt(){
        return Neos::count();
    }
    // 获取所有危险的行星
    public function getAsteroids($field = '*', $where = []) {
        return Neos::field($field)->where($where)->select();
    }
    // 获取最快的行星
    public function getFastestAsteroid($field = '*', $where = [], $order){
        return Neos::field($field)->where($where)->order($order)->limit(1)->select();
    }
    // 获取获取行星年度
    public function getMostAsteroidOfYear($field = '', $where = [], $order = '', $group = 'YEAR(date)'){
        return Neos::field($field)->where($where)->group($group)->order($order)->limit(1)->select();
    }
}
